
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>微信原生H5</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/layuiadmin/style/admin.css" media="all">
    <style>
    </style>
</head>
<body>

<div class="layui-fluid">

    <div class="layui-card">
        <div class="layui-card-header">
            微信原生H5
        </div>
        <div class="layui-card-body">
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label">支付号名称</label>
                    <div class="layui-input-block">
                        <input type="hidden" name="id" value="{if $info}{$info.id}{/if}">
                        <input type="hidden" name="pay_mode" value="1">
                        <input type="hidden" name="payment_type" value="1">
                        <input type="text" name="name" required  lay-verify="required" placeholder="自定义" autocomplete="off" class="layui-input" value="{if $info}{$info.name}{/if}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">mch_id</label>
                    <div class="layui-input-block">
                        <input type="text" name="mch_id" required lay-verify="required" placeholder="商户号" autocomplete="off" class="layui-input" value="{if $info}{$info.mch_id}{/if}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">app_id</label>
                    <div class="layui-input-block">
                        <input type="text" name="app_id" required lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input" value="{if $info}{$info.app_id}{/if}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">apiv3</label>
                    <div class="layui-input-block">
                        <input type="text" name="apiv3" required lay-verify="required" placeholder="请输入接口秘钥" autocomplete="off" class="layui-input" value="{if $info}{$info.apiv3}{/if}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">referer</label>
                    <div class="layui-input-block">
                        <input type="text" name="referer" required lay-verify="required" placeholder="请输入referer" autocomplete="off" class="layui-input" value="{if $info}{$info.referer}{/if}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">立即保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        {if !$info}
                        <button class="layui-btn layuiadmin-btn-admin layui-btn-primary" type="button" onclick="history.back();">
                            <i class="layui-icon layui-icon-return layuiadmin-button-btn"></i>返回
                        </button>
                        {/if}
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>


<script src="/static/layuiadmin/layui/layui.js"></script>

<script>
    layui.config({
        base: '/static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','table'], function() {
        var $ = layui.$
            , form = layui.form
            , table = layui.table
            , admin = layui.admin;

        form.on('submit(formDemo)', function(data){
            admin.req({
                url: '/tool/setPaymentNumber'
                , type: "POST"
                , data: data.field
                , done: function (res) {
                    layer.msg('保存成功', {icon: 1, time: 1000}, function () {
                    });
                }, not_finish: function (res) {
                    layer.msg(res.msg);
                }
            });
            return false;
        });

    });
</script>


</body>

</html>

